<extend name="Public/base" />
<block name="body"> <!-- 标题栏 -->
<div class="main-title">
	<h2>授权用户[ {$iteminfo.name} ]</h2>
</div>
<form action="{:U('writeusers')}" enctype="application/x-www-form-urlencoded"
	method="POST" class="form-horizontal auth-form">
	<volist name="department_list" id="department">
	<dl class="checkmod">
		<dt class="hd">
			<label class="checkbox">{$department}</label>
		</dt>
		<dd class="bd">
			<assign name="department_id" value="$key" />
			<div class="rule_check">
				<volist name="user_list" id="user"> 
				 <eq name="department_id" value="$user.department"> <label
					class="checkbox"> <input class="auth_rules"
					type="checkbox" name="users[]" value="{$user.uid}" />{$user.realname}({$user.nickname})
				</label> <span class="divsion"></span></eq> </volist>
			</div>
		</dd>
	</dl>
	</volist>
    <input type="hidden" name="id" value="{$id}" />
	<button type="submit" class="btn submit-btn ajax-post"
		target-form="auth-form">确 定</button>
	<button class="btn btn-return"
		onclick="javascript:history.back(-1);return false;">返 回</button>
</form>
</block>
<block name="script"> 
<script type="text/javascript" charset="utf-8">
+function($){
var users = [{$iteminfo.users}];
$('.auth_rules').each(function(){
    if( $.inArray( parseInt(this.value,10),users )>-1 ){
        $(this).prop('checked',true);
    }
});
        //导航高亮
        $('.side-sub-menu').find('a[href="{:U('index')}"]').closest('li').addClass('current');
 }(jQuery);
</script>
</block>